package rsj.api.product;

import com.rlyy.aibase.utils.base.Box;
import common.util.BoxUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import rsj.api.user.BaseLink;
import rsj.service.ProdTypeService;

import java.util.List;
import java.util.Map;
@RestController
public class GetProductTypeAll extends BaseLink {

    private static final ProdTypeService productService = ProdTypeService.getInstance();


    @RequestMapping(value = "rsj_prod_type")
    public Box executeLink(Box in){
        Map<String, List<Map<String, String>>> productTypeAll = productService.getProductTypeAll();

        Box box = BoxUtil.successBox(in, "获取产品信息！");
        box.toMap().put(BoxUtil.getWith_Key("data"), productTypeAll);
        return box;
    }

}
